Skip to content

Rename subDir to dir in initFlutter, treat as relative or absolute - #293

Merged
Rexios80 merged 3 commits into
IO-Design-Team:mainfrom
jheld:patch-1
Sep 27, 2026
Merged

Rexios80 merged 3 commits into
IO-Design-Team:mainfrom
jheld:patch-1

Conversation

@jheld

@jheld jheld commented Mar 6, 2026

Copy link
Copy Markdown
Contributor

The concept here is mostly related to wanting more control over where the hive files are actually stored. Most likely the user would be choosing a dart built-in directory, but in the spirit of giving power back to the user, it seems simplest to base their decision on whether or not the path is relative (and continuing to treat the default null as relative for backwards compatibility/sanity).

@Rexios80

Rexios80 commented Mar 6, 2026

Copy link
Copy Markdown
Member

This would be a breaking change. If you need more control, you can create your own init method that makes the same calls as initFlutter.

@Rexios80 Rexios80 closed this Mar 6, 2026
@jheld

jheld commented Mar 6, 2026

Copy link
Copy Markdown
Contributor Author

This would be a breaking change. If you need more control, you can create your own init method that makes the same calls as initFlutter.

For curiosity sake, how is this a breaking change? null is treated the same, and non-absolute paths are treated the same. And the variable is only a positional argument.

Is there concern that people are passing in absolute (e.g. leading /) paths in here? if they are, then basically we're joining an absolute path with another absolute path and that itself, although is "legal" does feel a bit like undefined behavior given that typically people don't use / in their directory names. If that's the only concern, then I'd be fine creating initFlutterAbsoluteDir in this repo. It's very limiting that this repo does not give the user the ability to choose the entire path when it's a fairly small change to allow it.

And as far as breaking changes go, then increment the version to make it clear it's a breaking change - how can this change be so controversial?

@Rexios80

Rexios80 commented Mar 7, 2026

Copy link
Copy Markdown
Member

You're correct sorry. I missed that it is a positional argument not a named one. I'll take another look next week.

@Rexios80 Rexios80 reopened this Mar 7, 2026
@Rexios80
Rexios80 merged commit 9c35f33 into IO-Design-Team:main Sep 27, 2026
1 check passed
@Rexios80

Copy link
Copy Markdown
Member

Sorry this took so long to get in. The past 6 months were kinda rough lol. Thank you for the contribution!

@Rexios80 Rexios80 mentioned this pull request Sep 27, 2026
5 of 6 tasks
@Rexios80

Copy link
Copy Markdown
Member

Released in hive_ce_flutter 2.4.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants